package net.hn.hnms.biz.common.jpa.utils;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

/**
 * 为了统一其它同事使用的mybatis 分页参数，需要改造jpa分页参数
 * 智呈物联 pan'sx
 * 2022/8/30 11:02
 * 1.0 version
 */
@ApiModel("分页请求参数")
@Getter
@Setter
public class CsiitPageRequest extends PageRequest {
    private int pageSize;
    private int pageNum;


    /**
     * Creates a new {@link PageRequest} with sort parameters applied.
     *
     * @param pageNum  zero-based page index, must not be negative.
     * @param pageSize the size of the page to be returned, must be greater than 0.
     * @param sort     must not be {@literal null}, use {@link Sort#unsorted()} instead.
     */


    public CsiitPageRequest(int pageSize, int pageNum, Sort sort) {
        super(pageNum, pageSize, sort);
        this.pageSize = pageSize;
        this.pageNum = pageNum;
    }

    public CsiitPageRequest(int pageSize, int pageNum) {
        super(pageNum, pageSize, Sort.unsorted());

    }
}
